package com.crm.jdy.service.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.jdy.common.dto.TeamInfoDto;
import com.crm.jdy.common.mapper.SupplierInfoMapper;
import com.crm.jdy.common.pojo.ClientChargeInfo;
import com.crm.jdy.common.pojo.TeamInfo;
import com.crm.jdy.common.mapper.TeamInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**   
 * @Description:(团队信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class TeamInfoServiceImpl  extends ServiceImpl<TeamInfoMapper,TeamInfo> implements TeamInfoService  {

    @Autowired
    TeamInfoMapper teamInfoMapper;

    @Override
    public PageInfo<TeamInfo> seleteTeamInfo(TeamInfoDto teamInfoDto) {
            PageHelper.startPage( teamInfoDto.getCurrentPage(),teamInfoDto.getPageSize());
            List<TeamInfo> bookList = teamInfoMapper.seleteTeamInfo(teamInfoDto);
            PageInfo<TeamInfo> pageInfo = new PageInfo<TeamInfo>(bookList);
         return pageInfo;
    }

    @Override
    public boolean updateTeamInfo(TeamInfo teamInfo) {
        return teamInfoMapper.updateById(teamInfo) > 0;
    }

    @Override
    public boolean addTeamInfo(TeamInfo teamInfo) {
        return teamInfoMapper.insert(teamInfo) > 0;
    }

    @Override
    public boolean removeTeamInfo(String teamId) {
        return teamInfoMapper.deleteById(teamId) > 0;
    }


}